<template>
  <el-table
    :data="value"
    border
    tooltip-effect="dark"
  >
    <el-table-column
      label="买家"
      width="200">
      <template slot-scope="scope">
        <h-user-display v-model="scope.row.buyer"/>
      </template>
    </el-table-column>
    <el-table-column
      label="商品信息"
      min-width="280">
      <template slot-scope="scope">
        <h-good-info-display v-model="scope.row" :admin="admin"/>
      </template>
    </el-table-column>
    <el-table-column
      label="商品规格"
      min-width="120"
    >
      <template slot-scope="scope">
        <h-specs-display v-model="scope.row"/>
      </template>
    </el-table-column>
    <el-table-column label="订单信息" min-width="200">
      <template slot-scope="scope">
        <h-order-info-display v-model="scope.row"/>
      </template>
    </el-table-column>
    <el-table-column
      label="订单金额"
      min-width="150">
      <template slot-scope="scope">
        <h-order-pay-info-display v-model="scope.row"></h-order-pay-info-display>
      </template>
    </el-table-column>
    <el-table-column
      label="状态信息" width="120" align="center">
      <template slot-scope="scope">
        <h-order-status-display v-model="scope.row" :arrival="true" :pay="true" :dispatch="true"
                                :apply="true"></h-order-status-display>
      </template>
    </el-table-column>
    <slot/>
  </el-table>
</template>
<script>
  import HOrderStatusDisplay from 'src/components/common/display/HOrderStatusDisplay'
  import HOrderInfoDisplay from 'src/components/common/display/HOrderInfoDisplay'
  import HOrderPayInfoDisplay from 'src/components/common/display/HOrderPayInfoDisplay'
  import HSpecsDisplay from 'src/components/common/display/HSpecsDisplay'
  import HGoodInfoDisplay from 'src/components/common/display/HGoodInfoDisplay'
  import HUserDisplay from 'src/components/common/display/HUserDisplay'

  export default {
    name: 'HOrderDisplay',
    components: {
      HOrderStatusDisplay,
      HOrderInfoDisplay,
      HOrderPayInfoDisplay,
      HSpecsDisplay,
      HGoodInfoDisplay,
      HUserDisplay
    },
    data() {
      return {}
    },
    props: {
      value: {
        type: Array,
        default: function () {
          return []
        }
      },
      admin: {
        type: Boolean,
        default: false
      }
    }
  }
</script>
